Skip to content

Implement min/max advertisement interval#60

Merged
spacecheese merged 2 commits intospacecheese:developfrom
vinicentus:advertisement-interval
Apr 7, 2026
Merged

Implement min/max advertisement interval#60
spacecheese merged 2 commits intospacecheese:developfrom
vinicentus:advertisement-interval

Conversation

@vinicentus
Copy link
Copy Markdown

This change allows specifying advertisement intervals.

This has been written by AI (Cursor), but verified by me. It's tested and working. See this excerpt from btmon, showing that the min & max interval are correclty set to 20ms & 50ms as specified in my application code using this library.

bluetoothd[1295]: @ MGMT Command: Add Extended Advertising Parameters (0x0054) plen 18                                                                                                  {0x0001} [hci0] 5801.230514
        Instance: 1
        Flags: 0x00015001
          Switch into Connectable mode
          Use provided duration parameter
          Use provided interval parameters
          Contain Scan Response Data
        Duration: 2
        Timeout: 0
        Min advertising interval: 20.000 msec (0x0020)
        Max advertising interval: 50.000 msec (0x0050)
        TX power: 0 dbm (0x00)
< HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25                                                                                                                  #73 [hci0] 5801.230745
        Handle: 0x01
        Properties: 0x0013
          Connectable
          Scannable
          Use legacy advertising PDUs: ADV_IND
        Min advertising interval: 20.000 msec (0x0020)
        Max advertising interval: 50.000 msec (0x0050)
        Channel map: 37, 38, 39 (0x07)
        Own address type: Public (0x00)
        Peer address type: Public (0x00)
        Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
        TX power: Host has no preference (0x7f)
        Primary PHY: LE 1M (0x01)
        Secondary max skip: 0x00
        Secondary PHY: LE 1M (0x01)
        SID: 0x00
        Scan request notifications: Disabled (0x00)

I chose to base this on top of develop instead of main since the structure of Advertisment was changed in a way where the implementation was easier. Hopefully that's ok? Alternatively this could be merged into main after develop is?

@spacecheese spacecheese merged commit d8b21c2 into spacecheese:develop Apr 7, 2026
11 checks passed
@spacecheese
Copy link
Copy Markdown
Owner

Looks good to me, thanks for the PR. I have some test updates in the works I will bring in before I release a new alpha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants